
function $F(fctId){
	return document.getElementById(fctId);
}

function F(objName)
{
    return document.getElementById(objName);
}

function c$(fctId,fctClassName){
	var varTempDivObj=$F(fctId);
	if(!varTempDivObj){
		//GetIframe("ifm"+fctId);
		varTempDivObj=document.createElement("div");
		varTempDivObj.id=fctId;
		if(fctClassName && fctClassName!="")varTempDivObj.className=fctClassName;
		document.body.appendChild(varTempDivObj);
	}
	return varTempDivObj;
}

function GetIframe(fctIfmId,fctVisibility,fctTop,fctLeft,fctWidth,fctHeight){
	var frmCity=$F(fctIfmId);
	if(!frmCity){
		frmCity=document.createElement("iframe");
		frmCity.id=fctIfmId;
		frmCity.style.position="absolute";
		frmCity.style.zIndex="1";
		frmCity.style.visibility="hidden";
		document.body.appendChild(frmCity);
	}
	if(fctTop)frmCity.style.top=fctTop+"px";
	if(fctLeft)frmCity.style.left=fctLeft+"px";
	if(fctWidth)frmCity.style.width=fctWidth+"px";
	if(fctHeight)frmCity.style.height=fctHeight+"px";
	if(fctVisibility)frmCity.style.visibility=(document.all?fctVisibility:"hidden	");
	return frmCity;
}

function getPosition(obj){
	var top=0;
	var left=0;
	var width=obj.offsetWidth;
	var height=obj.offsetHeight;
	while(obj.offsetParent){
		top+=obj.offsetTop;
		left+=obj.offsetLeft;
		obj=obj.offsetParent;
	}
	return{"top":top,"left":left,"width":width,"height":height};
}


function GetValueToInputObj(fctThisObj){
	if(!fctThisObj)return null;
	var varThisObjAutoInput=(fctThisObj.getAttributeNode("value_to_input")?fctThisObj.getAttributeNode("value_to_input").value:"");
	if(varThisObjAutoInput=="")return null;
	return $F(varThisObjAutoInput);
}


function AutoNextInputAct(fctThisObj,fctAct){
	var varNextInput=fctThisObj.getAttributeNode("nextinput");
	if(varNextInput && varNextInput!=""){
		if(document.all){
			eval("$F('"+varNextInput.value+"')."+fctAct+"()");
		}else{
			var evt = document.createEvent("MouseEvents");
			evt.initEvent(fctAct,true,true);
			$F(varNextInput.value).dispatchEvent(evt);
		}
		$F(varNextInput.value).focus();
	}
}

function AddFunToObj(fctObj,fctAct,fctFunction){
	if(fctObj.addEventListener){
		fctObj.addEventListener(fctAct.replace("on",""),function(e){
			e.cancelBubble=!eval(fctFunction);
		},false);
	}else if(fctObj.attachEvent){
		fctObj.attachEvent(fctAct,function(){
			return eval(fctFunction);
		});
	}
}
document.write('\
	<style type="text/css">\
		#divAddressMenu {line-height:20px;text-align:left;position:absolute;visibility:hidden;z-index:10000;;overflow:hidden;width:14.8%;background:#fff;border:solid #1bd9c3 1px;border-top:gray solid 1px;font-size:12px;}\
		#divAddressMenu h4{border-bottom:dotted #CCCCCC 1px;color:#999999;font-size:12px; font-weight:100; padding:2px 2px 0 2px; margin:0;}\
		#divAddressMenu div{padding:1px;}\
		#divAddressMenu a {display:block;font-size:14px;width:100%;padding:1px 2px 2px 2px;cursor:default;text-decoration:none;color:#000;background-color:none;}\
		#divAddressMenu a span{float:right;font-family:vernada }\
		#divAddressMenu a:hover {border:solid #1bd9c3 1px;background-color:#ecfafa;}\
	    .sel {border:solid 1px #1bd9c3;background-color:#ccf }\
	</style>\
');
var PageId=0,PageNum;

function GetCityList(fctThisObj){
	var varMenuObj=c$("divAddressMenu");
	var varThisObj=fctThisObj;
	if(varThisObj.id=="menuPageS"||varThisObj.id=="menuPageE"){
		varThisObj=varMenuObj.obj;
	}else{
		PageId=0;
	}
	var varAddressList = "@Anqing|安庆|aq|36|0@Bangbu|蚌埠|bb|37|@Chaohu|巢湖|ch|38|@Chizhou|池州|cz|39|"+
						 "@Chuzhou|滁州|cz|40|@Fuyang|阜阳|fy|41|@Hefei|合肥|hf|42|@Huaibei|淮北|hb|43|"+
						 "@Huainan|淮南|hn|44|@Huangshan|黄山|hs|45|@Liuan|六安|la|46|@Maanshan|马鞍山|mas|47|"+
						 "@Suzhouu|宿州|sz|48|@Tongling|铜陵|tl|49|@Wuhu|芜湖|wh|50|@Xuancheng|宣城|xc|51|"+
						 "@BoZhou|亳州|hz|52|@Beijing|北京|bj|53|@Fuzhou|福州|fz|54|@Longyan|龙岩|ly|55|"+
						 "@Nanping|南平|np|56|@Ningde|宁德|nd|57|@Putian|莆田|pt|58|@Quanzhou|泉州|qz|59|"+
						 "@Sanming|三明|sm|60|@Xiamen|厦门|xm|61|@Zhangzhou|漳州|zz|62|@Baiyin|白银|by|63|"+
						 "@Dingxi|定西|dx|64|@Gannan|甘南|gn|65|@Jiayuguan|嘉峪关|jyg|66|@Jinchang|金昌|jc|67|"+
						 "@Jiuquan|酒泉|jq|68|@Lanzhou|兰州|lz|69|@Linxia|临夏|lx|70|@Longnan|陇南|ln|71|"+
						 "@Pingliang|平凉|pl|72|@Qingyang|庆阳|qy|73|@Tianshui|天水|ts|74|@Wuwei|武威|ww|75|"+
						 "@Zhangye|张掖|zy|76|@Chaozhou|潮州|cz|77|@DongGuan|东莞|dg|78|@Foshan|佛山|fs|79|"+
						 "@Guangzhou|广州|gz|80|@Heyuan|河源|hy|81|@Huizhou|惠州|hz|82|@Jiangmen|江门|jm|83|"+
						 "@Jieyang|揭阳|jy|84|@Maoming|茂名|mm|85|@Meizhou|梅州|mz|86|@Qingyuan|清远|qy|87|"+
						 "@Shantou|汕头|st|88|@Shanwei|汕尾|sw|89|@Shaoguan|韶关|sg|90|@Shenzhen|深圳|sz|91|"+
						 "@Yangjiang|阳江|yj|92|@Yunfu|云浮|yf|93|@Zhanjiang|湛江|zj|94|@Zhaoqing|肇庆|zq|95|"+
						 "@Zhongshan|中山|zs|96|@Zhuhai|珠海|zh|97|@Baise|百色|bs|98|@Beihai|北海|bh|99|"+
						 "@Chongzuo|崇左|cz|100|@Fangchenggang|防城港|cfg|101|@Guilin|桂林|gl|102|@Guigang|贵港|gg|103|"+
						 "@Hechi|河池|hc|104|@Hezhou|贺州|hz|105|@Laibin|来宾|lb|106|@Liuzhou|柳州|lz|107|"+
						 "@Nanning|南宁|nn|108|@Qinzhou|钦州|qz|109|@Wuzhou|梧州|wz|110|@Yulin|玉林|yl|111|"+
						 "@Anshun|安顺|as|112|@Bijie|毕节|bj|113|@Guiyang|贵阳|gy|114|@Liupanshui|六盘水|lps|115|"+
						 "@Qiandong|黔东|qd|116|@Qiannan|黔南|qn|117|"+
						 "@Qianxi|黔西|qx|118|@Tongren|铜仁|tr|119|@Zunyi|遵义|zy|120|"+
						 "@Baisha|白沙|bs|121|@Baoting|保亭|bt|122|"+
						 "@Changjiang|昌江|cj|123|@Chengmaixian|澄迈县|cmx|124|@Dinganxian|定安县|dax|125|"+
						 "@Dongfang|东方|df|126|@Haikou|海口|hk|127|@Ledong|乐东|ld|128|"+
						 "@Lingaoxian|临高县|lgx|129|@Lingshui|陵水|ls|130|@Qionghai|琼海|qh|131|"+
						 "@Qiongzhong|琼中|qz|132|@Sanya|三亚|sy|133|@Tunchangxian|屯昌县|tcx|134|"+
						 "@Wanning|万宁|wn|135|@Wenchang|文昌|wc|136|@Wuzhishan|五指山|wzs|137|@DanZhou|儋州|dz|138|"+
						 "@Baoding|保定|bd|139|@Cangzhou|沧州|cz|140|@Chengde|承德|cd|141|@Handan|邯郸|hd|142|"+
						 "@Hengshui|衡水|hs|143|@Langfang|廊坊|lf|144|@Qinhuangdao|秦皇岛|qhd|145|"+
						 "@Shijiazhuang|石家庄|sjz|146|@Tangshan|唐山|ts|147|@Xingtai|邢台|xt|148|"+
						 "@Zhangjiakou|张家口|zjk|149|@Anyang|安阳|ay|150|@Hebi|鹤壁|hb|151|@Jiyuan|济源|jy|152|"+
						 "@Jiaozuo|焦作|jz|153|@Kaifeng|开封|kf|154|@Luoyang|洛阳|ly|155|@Nanyang|南阳|ny|156|"+
						 "@Pingdingshan|平顶山|pds|157|@Sanmenxia|三门峡|smx|158|@Shangqiu|商丘|sq|159|@Xinxiang|新乡|xx|160|"+
						 "@Xinyang|信阳|xy|161|@Xuchang|许昌|xc|162|@Zhengzhou|郑州|zz|163|@Zhoukou|周口|zk|164|"+
						 "@Zhumadian|驻马店|zmd|165|@LuoHe|漯河|lh|166|@PuYang|濮阳|py|167|@Daqing|大庆|dq|168|"+
						 "@Daxinganling|大兴安岭|dxal|169|@Haerbin|哈尔滨|heb|170|@Hegang|鹤岗|hg|171|@Heihe|黑河|hh|172|"+
						 "@Jixi|鸡西|jx|173|@Jiamusi|佳木斯|jms|174|@Mudanjiang|牡丹江|mdj|175|@Qitaihe|七台河|qth|176|"+
						 "@Qiqihaer|齐齐哈尔|qqhe|177|@Shuangyashan|双鸭山|sys|178|@Suihua|绥化|sh|179|@Yichun|伊春|yc|180|"+
						 "@Ezhou|鄂州|ez|181|@Enshi|恩施|es|182|@Huanggang|黄冈|hg|183|"+
						 "@Huangshi|黄石|hs|184|@Jingmen|荆门|jm|185|@Jingzhou|荆州|jz|186|@Qianjiang|潜江|qj|187|"+
						 "@Shennongjia|神农架|snj|188|@Shiyan|十堰|sy|189|@Suizhou|随州|sz|190|@Tianmen|天门|tm|191|"+
						 "@Wuhan|武汉|wh|192|@Xiantao|仙桃|xt|193|@Xianning|咸宁|xy|194|@Xiangfan|襄樊|xf|195|"+
						 "@Xiaogan|孝感|xg|196|@Yichang|宜昌|yc|197|@Changde|常德|cd|198|@Changsha|长沙|cs|199|"+
						 "@Chenzhou|郴州|cz|200|@Hengyang|衡阳|hy|201|@Huaihua|怀化|hh|202|@Loudi|娄底|ld|203|"+
						 "@Shaoyang|邵阳|sy|204|@Xiangtan|湘潭|xt|205|@Xiangxi|湘西|xx|206|@Yiyang|益阳|yy|207|"+
						 "@Yongzhou|永州|yz|208|@Yueyang|岳阳|yy|209|@Zhangjiajie|张家界|zjj|210|@Zhuzhou|株洲|zz|211|"+
						 "@Baicheng|白城|bc|212|@Baishan|白山|bs|213|@Changchun|长春|cc|214|@Jilin|吉林|jl|215|"+
						 "@Liaoyuan|辽源|ly|216|@Siping|四平|sp|217|@Songyuan|松原|sy|218|@Tonghua|通化|th|219|"+
						 "@Yanbian|延边|yb|220|@Changzhou|常州|cz|221|@Huaian|淮安|ha|222|@Lianyungang|连云港|lyg|223|"+
						 "@Nanjing|南京|nj|224|@Nantong|南通|nt|225|@Suzhou|苏州|sz|226|@Suqian|宿迁|sq|227|"+
						 "@Taizhou|泰州|tz|228|@Wuxi|无锡|wx|229|@Xuzhou|徐州|xz|230|@Yancheng|盐城|yc|231|"+
						 "@Yangzhou|扬州|yz|232|@Zhenjiang|镇江|zj|233|@Fuzhou|抚州|fz|234|@Ganzhou|赣州|gz|235|"+
						 "@Jian|吉安|ja|236|@Jingdezhen|景德镇|jdz|237|@Jiujiang|九江|jj|238|@Nanchang|南昌|nc|239|"+
						 "@Pingxiang|萍乡|px|240|@Shangrao|上饶|sr|241|@Xinyu|新余|xy|242|@Yichun|宜春|yc|243|"+
						 "@Yingtan|鹰潭|yt|244|@Anshan|鞍山|as|245|@Benxi|本溪|bx|246|@Chaoyang|朝阳|cy|247|"+
						 "@Dalian|大连|dl|248|@Dandong|丹东|dd|249|@Fushun|抚顺|as|250|@Fuxin|阜新|fx|251|"+
						 "@Huludao|葫芦岛|hld|252|@Jinzhou|锦州|jz|253|@Liaoyang|辽阳|ly|254|@Panjin|盘锦|pj|255|"+
						 "@Shenyang|沈阳|cy|256|@Tieling|铁岭|yl|257|@Yingkou|营口|yk|258|@Alashanmeng|阿拉善盟|alsm|259|"+
						 "@Bayannaoer|巴彦淖尔|byne|260|@Baotou|包头|bt|261|@Chifeng|赤峰|cf|262|@Eerduosi|鄂尔多斯|eeds|263|"+
						 "@Huhehaote|呼和浩特|hhht|264|@Hulunbeier|呼伦贝尔|hlbe|265|@Tongliao|通辽|tl|266|"+
						 "@Wuhai|乌海|wh|267|@Wulanchabushi|乌兰察布|wlcb|268|@Xilinguole|锡林郭勒|xlgl|269|"+
						 "@Xinganmeng|兴安盟|xam|270|@Guyuan|固原|gy|271|@Shizuishan|石嘴山|szs|272|@Wuzhong|吴忠|wz|273|"+
						 "@Yinchuan|银川|yc|274|@Guoluo|果洛|gl|275|@Haibei|海北|hb|276|"+
						 "@Haidong|海东|hd|277|@Hainan|海南|hn|278|@Haixi|海西|hx|279|"+
						 "@Huangnan|黄南|hn|280|@Xining|西宁|xn|281|@Yushu|玉树|ys|282|"+
						 "@Binzhou|滨州|bz|283|@Dezhou|德州|dz|284|@Dongying|东营|dy|285|@Heze|菏泽|hz|286|"+
						 "@Jinan|济南|jn|287|@Jining|济宁|jn|288|@Laiwu|莱芜|lw|289|@Liaocheng|聊城|lc|290|"+
						 "@Linyi|临沂|ly|291|@Qingdao|青岛|qd|292|@Rizhao|日照|rz|293|@Taian|泰安|ta|294|"+
						 "@Weihai|威海|wh|295|@Weifang|潍坊|wf|296|@Yantai|烟台|yt|297|@Zaozhuang|枣庄|zz|298|"+
						 "@Zibo|淄博|zb|299|@Changzhi|长治|cz|300|@Datong|大同|dt|301|@Jincheng|晋城|jc|302|"+
						 "@Jinzhong|晋中|jz|303|@Linfen|临汾|lf|304|@Lvliang|吕梁|ll|305|@Shuozhou|朔州|sz|306|"+
						 "@Taiyuan|太原|ty|307|@Xinzhou|忻州|xz|308|@Yangquan|阳泉|yq|309|@Yuncheng|运城|yc|310|"+
						 "@Ankang|安康|ak|311|@Baoji|宝鸡|bj|312|@Hanzhong|汉中|hz|313|@Shangluo|商洛|sl|314|"+
						 "@Tongchuan|铜川|tc|315|@Weinan|渭南|wn|316|@Xian|西安|xa|317|@Xianyang|咸阳|xy|318|"+
						 "@Yanan|延安|ya|319|@Yulin|榆林|yl|320|@Shanghai|上海|sh|321|@Aba|阿坝|ab|322|"+
						 "@Bazhong|巴中|bz|323|@Chengdu|成都|cd|324|@Dazhou|达州|dz|325|@Deyang|德阳|dy|326|"+
						 "@Ganzi|甘孜|gz|327|@Guangan|广安|ga|328|@Guangyuan|广元|gy|329|@Leshan|乐山|ls|330|"+
						 "@Liangshan|凉山|ls|331|@Meishan|眉山|ms|332|@Mianyang|绵阳|my|333|@Nanchong|南充|nc|334|"+
						 "@Neijiang|内江|nj|335|@Panzhihua|攀枝花|pzh|336|@Suining|遂宁|sn|337|@Yaan|雅安|ya|338|"+
						 "@Yibin|宜宾|yb|339|@Ziyang|资阳|zy|340|@Zigong|自贡|zg|341|@LuZhou|泸州|lz|342|"+
						 "@Tianjin|天津|tj|343|@Ali|阿里|al|344|@Changdu|昌都|cd|345|@Lasa|拉萨|ls|346|"+
						 "@Linzhi|林芝|lz|347|@Naqu|那曲|nq|348|@Rikaze|日喀则|rkz|349|@Shannan|山南|sn|350|"+
						 "@Akesu|阿克苏|aks|351|@Alaer|阿拉尔|ale|352|@Bayinguoleng|巴音郭楞|bygl|353|"+
						 "@Boertala|博尔塔拉|betl|354|@Changji|昌吉|cj|355|"+
						 "@Hami|哈密|hm|356|@Hetian|和田|ht|357|@Kashi|喀什|ks|358|@Kelamayi|克拉玛依|klmy|359|"+
						 "@Kezilesukeerkezizizhizhou|克孜|kz|360|@Shihezi|石河子|shz|361|@Tumushuke|图木舒克|tmsk|362|"+
						 "@Tulufan|吐鲁番|tlf|363|@Wulumuqi|乌鲁木齐|wlmq|364|@Wujiaqu|五家渠|wjq|365|@Yili|伊犁|yl|366|"+
						 "@Baoshan|保山|bs|367|@Chuxiong|楚雄|cx|368|@Dali|大理|dl|369|"+
						 "@Dehong|德宏|dh|370|@Diqing|迪庆|dq|371|"+
						 "@Honghe|红河|hh|372|@Kunming|昆明|km|373|@Lijiang|丽江|lj|374|"+
						 "@Lincang|临沧|lc|375|@Nujiang|怒江|nj|376|@Qujing|曲靖|qj|377|@Simao|思茅|sm|378|"+
						 "@Wenshan|文山|ws|379|@Xishuangbanna|西双版纳|xsbn|380|"+
						 "@Yuxi|玉溪|yx|381|@Zhaotong|昭通|zt|382|@Hangzhou|杭州|hz|383|@Huzhou|湖州|hz|384|"+
						 "@Jiaxing|嘉兴|jx|385|@Jinhua|金华|jh|386|@Lishui|丽水|ls|387|@Ningbo|宁波|nb|388|"+
						 "@Shaoxing|绍兴|sx|389|@Taizhou|台州|tz|390|@Wenzhou|温州|wz|391|@Zhoushan|舟山|zs|392|"+
						 "@QuZhou|衢州|qz|393|@Chongqing|重庆|cq|394|@Xianggang|香港|xg|395|@Aomen|澳门|am|396|"+
						 "@Gaoxiong|高雄|gx|397|@Hualian|花莲|hl|398|@Jilong|基隆|jl|399|@Jiayi|嘉义|jy|400|"+
						 "@Taibei|台北|tb|401|@Taidong|台东|yd|402|@Tainan|台南|tn|403|@Taizhong|台中|tz|404|"+
						 "@Zhongwei|中卫|zw|3105|@Tacheng|塔城|tc|3113|@Aletai|阿勒泰|alt|3114|@Wusulijiang|乌苏里江|wslj|3143|"+
						 "@Chibishi|赤壁市|cbs|3280|@Shunde|顺德|sd|3281|@";

   // varAddressList =varAddressList +'xuanhuaqu|宣化|XH|1758|1@hengdianzhen|横店|XH|2593|1@';

    if(document.getElementById("CityList") != null && document.getElementById("CityList").value != "")
        varAddressList=document.getElementById("CityList").value; 
	var varThisObjAutoInput=GetValueToInputObj(varThisObj); 
	if(varThisObjAutoInput)varThisObjAutoInput.value="";
	
	var varObjValue=varThisObj.value;
	var varThisObjAdd=(varThisObj.getAttributeNode("mod_address_suggest")?varThisObj.getAttributeNode("mod_address_suggest").value:"");
	var varData=(varObjValue==""?(varThisObjAdd==""?varAddressList:varThisObjAdd):varAddressList);
	var varHtmlStr="",varCityDataSplit=varData.split("@"),varCityDataSplitI,varCityDataSplitIu,varNextPageStr="";
	
	varMenuObj.obj=varThisObj;
	var varPageRCount=(varThisObj.getAttributeNode("pagecount")?parseInt(varThisObj.getAttributeNode("pagecount").value,10):8);
	
	var varThisPageI=0
	for(var i=1;i<varCityDataSplit.length-1;i++){
		varCityDataSplitI=varCityDataSplit[i];
		
		varCityDataSplitISplit=varCityDataSplitI.split("|");
		
		if(varCityDataSplitI.toUpperCase().indexOf(varObjValue.toUpperCase())==0|| varCityDataSplitISplit[2].toUpperCase().indexOf(varObjValue.toUpperCase())==0|| varCityDataSplitISplit[1].toUpperCase().indexOf(varObjValue.toUpperCase())>=0 || varObjValue=="" || i==varObjValue){ // || varCityDataSplitI.toLowerCase().indexOf(varObjValue.toLowerCase())>=0
		    
			varThisPageI+=1;
			if(varThisPageI>PageId*varPageRCount && varThisPageI<=(PageId+1)*varPageRCount){
				//varCityDataSplitISplit=varCityDataSplitI.split("|");
				varHtmlStr+="<a href='javascript:;' onclick='GetCity("+varThisPageI+")' id='menuA"+varThisPageI+"' title='"+varCityDataSplitI+"'><span>"+varCityDataSplitISplit[0]+"&nbsp;&nbsp;</span>"+varCityDataSplitISplit[1]+"</a>";//("+varCityDataSplitISplit[2]+")
			}			
		}
	}
	
	PageNum=parseInt(varThisPageI/varPageRCount)+1;
	
	if(varThisPageI>varPageRCount){
		varNextPageStr="&nbsp;<span id=menuPageS style="+(PageId>0?"cursor:pointer;":"color:#ccc;")+"font-family:Verdana>&lt;&lt;&nbsp;上一页</span><span style='margin:0 8px 0 8px'>"+(PageId+1)+"/"+PageNum+"</span>"
		varNextPageStr+="<span id=menuPageE style="+(varThisPageI>(PageId+1)*varPageRCount?"cursor:pointer;":"color:#ccc;")+"font-family:Verdana>下一页&nbsp;&gt;&gt;</span>";
	}
	var varThisObjPosition=getPosition(varThisObj);
	with(varMenuObj){
		style.top=varThisObjPosition.top+varThisObjPosition.height+2+"px";
		style.left=varThisObjPosition.left+3+"px";
		style.visibility="visible";
		innerHTML="<div><h4 style='font-size:14px'>输入中文/拼音来选择城市</h4>"+(varHtmlStr==""?"<nobr>‘"+varObjValue+"’没有相应城市信息。</nobr>":varHtmlStr+varNextPageStr)+"</div>";
	}
	
	return false;
}

function GetCity(fctI){
	var varMenuObj=c$("divAddressMenu");
	var varThisObj=varMenuObj.obj;
	var varMenuValue=$F("menuA"+fctI).title;
	varMenuValue=varMenuValue.split("|"); 
	varThisObj.value=varMenuValue[1]; 
	/*var hidObj = $F('hotelcity');
	hidObj.value=varMenuValue[3]; hidObj.select();
	$F("hfCityLevel").value = varMenuValue[4];
	try{ CityChanged(e); } catch(e){ CityChanged(e); } */     //外部接口
}

function _Hidden(e){
	e=e?e:event;
	var varMenuObj=c$("divAddressMenu");
	var varThisObj=varMenuObj.obj;
	if(varMenuObj.style.visibility!="hidden"){
		if(e){
			var EventOBJ=(e.srcElement?e.srcElement:e.target);
			if(EventOBJ.id=="menuPageS" && EventOBJ.style.color==""){
				PageId=PageId-1;
				GetCityList(EventOBJ);$F('city').focus(); index = -1;
			}
			if(EventOBJ.id=="menuPageE" && EventOBJ.style.color==""){
				PageId=PageId+1;
				GetCityList(EventOBJ);$F('city').focus(); index = -1;
			}
			if(varThisObj==EventOBJ || EventOBJ.id.indexOf("menuPage")==0 || EventOBJ.id.indexOf("divAddressMenu")==0) return false;
		}
		
		var varThisObjAutoInput=GetValueToInputObj(varThisObj);
		if($F("menuA1")){
			if(!varThisObjAutoInput)varThisObjAutoInput=varThisObj;
			if(varThisObjAutoInput.value=="" || varThisObjAutoInput==varThisObj){
				 var objVal = varThisObjAutoInput.value;
				 lstCity = $F("divAddressMenu"); 
				 var lks = lstCity.getElementsByTagName('a');
				 var verify = false;
				 for(var i=0;i<lks.length;i++){
					 var title = lks[i].title;
					 var menuValue=title.split("|");
					 if(objVal==menuValue[1]){
						 verify = true;
						 break;
					 }
				 }
				 if(!verify) varThisObjAutoInput.value='';
			}
		}else if(EventOBJ.id.indexOf("menuA")<0){
			if(varThisObj)varThisObj.value="";
		}
		varMenuObj.style.visibility="hidden";
		//GetIframe("ifm"+varMenuObj.id,"hidden");
	}
}

function HiddenDateBox(){
	if($F("divDateBox")){
		if($F("divDateBox").style.visibility!="hidden" && $F("divDateBox").bodyclick=="1"){
			$F("divDateBox").style.visibility="hidden";
			$F("divDateBox").bodyclick="";
			GetIframe("ifmdivDateBox","hidden");
		}else{
			$F("divDateBox").bodyclick="1";
		}
	}
}
AddFunToObj(window,"onload","AddFunToObj(document,'onclick','_Hidden("+(document.all?"":"e")+");HiddenDateBox();');");

/*键盘选择的处理*/
var index = -1; var lstCity;
function selCity(e){    
    var event = e||window.event;    
    var keyCode = event.charCode||event.keyCode;     
    if(keyCode!=13&&(keyCode<37||keyCode>40)) { GetCityList($F('city')); stopBubble(e); return;}
    lstCity = $F("divAddressMenu"); 

    var lks = lstCity.getElementsByTagName('a');   //选中的城市在列表中序号   
    if(keyCode==13) { if(index<0) index=0;lks[index].click(); 
        if( lstCity.style.visibility!="hidden") stopBubble(e);     //选择城市
        lstCity.style.visibility="hidden"; //GetIframe("ifm"+c$("divAddressMenu").id,"hidden"); 
    }
    else if(keyCode==38) {        //向上 ||keyCode==37
        index--; if(index<0) index = lks.length-1; 
   } 
    else if(keyCode==40) {     //向下keyCode==39||
        index++; if(index>=lks.length) index = 0 ;
    }
    else if(keyCode==37){
        PageId--; if(PageId<0) PageId = PageNum-1; GetCityList($F('menuPageS')); index = -1; return;
    }  
    else if(keyCode==39){
        PageId++; if(PageId>=PageNum) PageId = 0; GetCityList($F('menuPageS')); index = -1; return;
    }   
    setCityListStyle(index,lks); 
}

function setCityListStyle(index,lks){
    for(var i=0;i<lks.length;i++) {lks[i].className = '';lks[i].style.color = '#008e91'; }
    lks[index].className = 'sel'; lks[index].style.color = 'red';
}

//输入关键字onblur事件默认选择第一个
function DefaultselCity(){  
    var hidObj = $F('hotelcity');   
    lstCity = $F("divAddressMenu");     
	if(hidObj.value=="" && index!=0 && PageNum>1)  return;  //不输入关键字则不执行默认选择
	
    var lks = lstCity.getElementsByTagName('a');   //选中的城市在列表中序号   
   
	if(lks.length==0)  return;     //输入没有匹配的关键字则返回
	
    if(index<0) index=0; lks[index].onclick(); 
    if( lstCity.style.visibility!="hidden") stopBubble(e);     //选择城市
    lstCity.style.visibility="hidden"; //GetIframe("ifm"+c$("divAddressMenu").id,"hidden"); 
    
    setCityListStyle(index,lks); 
}


function stopBubble(e)  //取消事件上冒
{
    if(!document.all)/* 非IE */
    {
        e.stopPropagation();/* 标准W3C的取消冒泡 */
        e.preventDefault(); /* 取消默认行为 */
    }
    else
    {
        event.cancelBubble = true;   /* IE的取消冒泡方式 */
        event.returnValue = false; /* IE的取消默认行为，如<a>的转向地址，类似于return false */
    }
}
